<?xml version="1.0"?>
<!--
    ***** BEGIN LICENSE BLOCK *****
    
    Copyright © 2006–2013 Center for History and New Media
                     George Mason University, Fairfax, Virginia, USA
                     http://zotero.org
    
    This file is part of Zotero.
    
    Zotero is free software: you can redistribute it and/or modify
    it under the terms of the GNU Affero General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.
    
    Zotero is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU Affero General Public License for more details.
    
    You should have received a copy of the GNU Affero General Public License
    along with Zotero.  If not, see <http://www.gnu.org/licenses/>.
    
    ***** END LICENSE BLOCK *****
-->
<!DOCTYPE window [
	<!ENTITY % editMenuOverlayDTD SYSTEM "chrome://zotero/locale/mozilla/editMenuOverlay.dtd" > %editMenuOverlayDTD;
	<!ENTITY % zoteroDTD SYSTEM "chrome://zotero/locale/zotero.dtd"> %zoteroDTD;
	<!ENTITY % preferencesDTD SYSTEM "chrome://zotero/locale/preferences.dtd"> %preferencesDTD;
]>

<?xml-stylesheet href="chrome://global/skin/global.css"?>
<?xml-stylesheet href="chrome://zotero-platform/content/preferences.css"?>
<?xml-stylesheet href="chrome://zotero/skin/preferences.css"?>
<?xml-stylesheet href="chrome://zotero/skin/zotero.css"?>
<?xml-stylesheet href="chrome://zotero-platform/content/overlay.css"?>
<?xml-stylesheet href="chrome://zotero-platform-version/content/style.css"?>

<!--
	To add an observer for a preference change, add an appropriate case in
	the switch statement in Zotero.Prefs.observe().
-->
<window id="zotero-prefs"
		data-l10n-id="preferences-window"
		onload="Zotero_Preferences.init()"
		onunload="Zotero_Preferences.onUnload()"
		windowtype="zotero:pref"
		xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
		xmlns:html="http://www.w3.org/1999/xhtml"
		width="800"
		height="600"
		style="display: flex;">
	
	<linkset>
		<html:link rel="localization" href="branding/brand.ftl"/>
		<html:link rel="localization" href="zotero.ftl"/>
		<html:link rel="localization" href="preferences.ftl"/>
	</linkset>
	
	<script>
		var { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm");
		
		Services.scriptloader.loadSubScript("chrome://zotero/content/include.js", this);
		Services.scriptloader.loadSubScript("chrome://zotero/content/charsetMenu.js", this);
		Services.scriptloader.loadSubScript("chrome://zotero/content/preferences/preferences.js", this);
		Services.scriptloader.loadSubScript("chrome://zotero/content/editMenuOverlay.js", this);

		// Mozilla scripts
		Services.scriptloader.loadSubScript("chrome://global/content/globalOverlay.js", this);
		Services.scriptloader.loadSubScript("chrome://global/content/contentAreaUtils.js", this);
		if (Zotero.isMac) {
			Services.scriptloader.loadSubScript("chrome://global/content/macWindowMenu.js", this);
		}
		
		// Custom elements
		Services.scriptloader.loadSubScript("chrome://zotero/content/customElements.js", this);
	</script>

	<keyset>
		<key id="key_close" modifiers="accel" key="W" oncommand="window.close()"/>
		<key modifiers="accel" key="L" oncommand="document.getElementById('prefs-search').focus()"/>
		<key id="key_find" modifiers="accel" key="F" oncommand="document.getElementById('prefs-search').focus()"/>
	</keyset>

	<html:div id="prefs-outer-container">
		<richlistbox id="prefs-navigation"></richlistbox>
		<html:div id="prefs-inner-container">
			<html:div id="prefs-search-container">
				<toolbarbutton
					id="prefs-subpane-back-button"
					aria-label="&zotero.pdfReader.back;"
					hidden="true"/>
				<search-textbox id="prefs-search" placeholder="&zotero.lookup.button.search;" timeout="1"/>
			</html:div>
			<html:div id="prefs-content" tabindex="-1">
				<html:div id="prefs-help-container">
					<button
						oncommand="Zotero_Preferences.openHelpLink()"
						label="&zotero.preferences.helpButton.label;"
						class="help-button" 
						align="end"/>
				</html:div>
			</html:div>
		</html:div>
	</html:div>
</window>
